# encoding: utf-8
# @File  : __init__.py
# @Author: wu shaofan
# @Date  :  2024/04/17
# @Desc : 运行整个框架前，先删除上次的日志文件
import os
import config



# 执行整个框架前，如果log_info目录下有上次的日志文件，先删除
def test_delete_log():
    directory = config.BASE_DIR + r'/logs_info'
    [os.remove(os.path.join(directory, f)) for f in os.listdir(directory) if f != '__init__.py']


# 执行整个框架前，如果log_error目录下有上次的日志文件，先删除
def test_delete_error_log():
    directory = config.BASE_DIR + r'/logs_error'
    [os.remove(os.path.join(directory, f)) for f in os.listdir(directory) if f != '__init__.py']


test_delete_log()
test_delete_error_log()